---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: d8-control-plane-manager
  namespace: kube-system
  {{- include "helm_lib_module_labels" (list . (dict "app" "d8-control-plane-manager")) | nindent 2 }}
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: d8:control-plane-manager
  namespace: kube-system
  {{- include "helm_lib_module_labels" (list . (dict "app" "d8-control-plane-manager")) | nindent 2 }}
rules:
- apiGroups: [""]
  resources: ["pods"]
  verbs: ["get", "watch", "list"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: d8:control-plane-manager
  namespace: kube-system
  {{- include "helm_lib_module_labels" (list . (dict "app" "d8-control-plane-manager")) | nindent 2 }}
subjects:
- kind: ServiceAccount
  name: d8-control-plane-manager
  namespace: kube-system
roleRef:
  kind: Role
  name: d8:control-plane-manager
  apiGroup: rbac.authorization.k8s.io

---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: d8:control-plane-manager
  {{- include "helm_lib_module_labels" (list . (dict "app" "d8-control-plane-manager")) | nindent 2 }}
rules:
  - apiGroups: [""]
    resources: ["nodes"]
    verbs: ["get", "list", "watch", "update"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: d8:control-plane-manager
  {{- include "helm_lib_module_labels" (list . (dict "app" "d8-control-plane-manager")) | nindent 2 }}
subjects:
  - kind: ServiceAccount
    name: d8-control-plane-manager
    namespace: kube-system
roleRef:
  kind: ClusterRole
  name: d8:control-plane-manager
  apiGroup: rbac.authorization.k8s.io
